<template>
  <div class="app-container">
      <el-button @click="refresh">刷新</el-button>
      <img :src="imgUrl" width="100%"/>
  </div>
</template>

<script>
import {getFlowImgByProcInstId} from './api/dynamicApi'

export default {
    name: 'TmptFlowImage',
    components: {},
    props:{
        procInstId: String,
        dialog4ProcImage: Boolean
    },
    data() {
        return {
            form:{},
            uiList:[],
            imgUrl:''
        }
    },
    computed: {
    },
    watch:{
        'procInstId': {
            immediate: true, // vue首次赋值不触发watch的解决方法
            handler: function(nval){
                this.getProcImage();
            }
        },
        'dialog4ProcImage': {
            immediate: true, // vue首次赋值不触发watch的解决方法
            handler: function(nval){
                if (nval) {
                    this.getProcImage();
                }
            }
        },

    },
    mounted() {
    },
    methods: {
        getProcImage() {
            getFlowImgByProcInstId(this.procInstId).then(r => {
                this.imgUrl = r.remark
                console.log(r)
            })
        },
        refresh() {
            this.getProcImage()
        }
    }
}
</script>
